<#import "/base/base.html" as base>
<@base.html  
    title="${(categorySeo.seoTitle)!' '}" 
    keywords="${(categorySeo.seoKeywords)!' '}" 
    description="${(categorySeo.seoDescription)!' '}">
<div class="bread-bg">
    <div class="bread-crumb">
        <ul>
            <li><a href="/">Home</a></li>
            <li> &gt;</li>
            <li><span>News</span></li>
            <#if currentCategory?? && currentCategory != ''>
                <li> &gt;</li>
                <#list news_categories as categoryData>
                    <#if categoryData.category.path == currentCategory>
                        <li><span>${categoryData.category.title!''}</span></li>
                    </#if>
                </#list>
            </#if>
        </ul>
    </div>
</div>

<div class="inner-page-middle">
    <div class="inner-page-content">
        <div class="inner-page-r">
            <#if news_categories??>
                <#if viewType == "detail">
                    <!-- 新闻详情页面 -->
                    <section class="news-detail">
                        <#list news_categories as categoryData>
                            <#list categoryData.articles as article>
                                <#if article.slug == currentSlug>
                                    <div class="news-detail-t">
                                        <#if article.customFields?? && article.customFields?has_content>
                                            <#assign fields = article.customFields?eval>
                                            <h1>${(fields.title)!''}</h1>
                                            <p class="time">${article.createTime?string('yyyy-MM-dd')}</p>
                                            <div class="news-detail-content">
                                                ${(fields.content)!''}
                            </div>
                                        </#if>
                                </div>
                                </#if>
                            </#list>
                        </#list>
            </section>
                <#else>
                    <!-- 新闻列表或分类页面 -->
                    <#list news_categories as categoryData>
                        <#if !currentCategory?? || currentCategory == categoryData.category.path>
            <section class="news-listing">
                <div class="news-listing-t">
                                    <h5><a href="/news/${categoryData.category.path!''}">${categoryData.category.title!''}</a></h5>
                                    <#if categoryData.articles?? && categoryData.articles?size gt 5>
                                        <span><a href="/news/${categoryData.category.path!''}">View All</a></span>
                                    </#if>
                </div>
                <ul>
                                    <#if categoryData.articles?? && categoryData.articles?size gt 0>
                                        <#list categoryData.articles as article>
                                            <li>
                                                <a href="/news/${categoryData.category.path!''}/${article.slug!''}">
                        <div class="news-listing-box">
                            <div class="news-listing-time">
                                                            <#if article.customFields?? && article.customFields?has_content>
                                                                <#assign fields = article.customFields?eval>
                                                                <h3>${(fields.title)!''}</h3>
                                                                <p>${(fields.news_desc)!''}</p>
                                                            </#if>
                                                            <p class="time">${article.createTime?string('yyyy-MM-dd')}</p>
                            </div>
                        </div>
                                                </a>
                                            </li>
                                        </#list>
                                    <#else>
                                        <li class="no-articles">No articles found in this category.</li>
                                    </#if>
                </ul>
            </section>
                        </#if>
                    </#list>
                </#if>
            </#if>
        </div>

        <!-- 左侧导航 -->
        <div class="inner-page-l">
            <div class="sidebar-block">
                <div class="sidebar-box sidebar-news">
                    <div class="sidebar-title">
                        <span>News Categories</span>
                    </div>
                    <div class="sidebar-contant">
                        <ul>
                            <#if news_categories??>
                                <#list news_categories as categoryData>
                                    <#assign category = categoryData.category>
                                    <li class="${(currentCategory == category.path)?string('active', '')}">
                                        <img src="/static/images/icons/right.svg" width="12" height="12">
                                        <a href="/news/${category.path!''}">${category.title!''}</a>
                            </li>
                                </#list>
                            </#if>
                        </ul>
                    </div>

<!--                <div class="sidebar-contant sidebar-product">-->
<!--                    <#if nav_products??>-->
<!--                    <#list nav_products as product>-->
<!--                    <dl>-->
<!--                        <dt>-->
<!--                            <a href="/products/${product.path!''}"-->
<!--                               title="${product.title!''}"-->
<!--                               class="${(currentCategory?? && currentCategory.id == product.id)?string('active', '')}">${product.title!''}</a>-->
<!--                        </dt>-->
<!--                    </dl>-->
<!--                </#list>-->
<!--            </#if>-->
<!--        </div>-->
                </div>
            <div class="sidebar-box">
                <div class="sidebar-title">
                    <span>Products</span>
                </div>
                <div class="sidebar-contant sidebar-product">
                    <#if nav_products??>
                    <#list nav_products as product>
                    <dl>
                        <dt>
                            <a href="/products/${product.path!''}"
                               title="${product.title!''}"
                               class="${(currentCategory?? && currentCategory.id == product.id)?string('active', '')}">${product.title!''}</a>
                        </dt>
                    </dl>
                </#list>
            </#if>
        </div>
</div>
            </div>
        </div>
    </div>
</div>



<style>
.news-detail {
    padding: 20px;
}
.news-detail-t {
    margin-bottom: 30px;
}
.news-detail-t h1 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}
.news-detail-t .time {
    color: #999;
    font-size: 14px;
}
.news-detail-content {
    line-height: 1.8;
    color: #666;
    margin-top: 20px;
}
</style>
</@base.html>
